/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(name = "detalleventa", catalog = "SIESCO", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detalleventa.findAll", query = "SELECT d FROM Detalleventa d"),
    @NamedQuery(name = "Detalleventa.findByIddetalleventa", query = "SELECT d FROM Detalleventa d WHERE d.iddetalleventa = :iddetalleventa"),
    @NamedQuery(name = "Detalleventa.findByIdventa", query = "SELECT d FROM Detalleventa d WHERE d.idventa = :idventa"),
    @NamedQuery(name = "Detalleventa.findByIdpresentacion", query = "SELECT d FROM Detalleventa d WHERE d.idpresentacion = :idpresentacion"),
    @NamedQuery(name = "Detalleventa.findByIdmarca", query = "SELECT d FROM Detalleventa d WHERE d.idmarca = :idmarca"),
    @NamedQuery(name = "Detalleventa.findByIdtipoazucar", query = "SELECT d FROM Detalleventa d WHERE d.idtipoazucar = :idtipoazucar"),
    @NamedQuery(name = "Detalleventa.findByCantidad", query = "SELECT d FROM Detalleventa d WHERE d.cantidad = :cantidad")})
public class Detalleventa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "iddetalleventa", nullable = false)
    private Integer iddetalleventa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idventa", nullable = false)
    private int idventa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idpresentacion", nullable = false)
    private int idpresentacion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idmarca", nullable = false)
    private int idmarca;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtipoazucar", nullable = false)
    private int idtipoazucar;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cantidad", nullable = false)
    private int cantidad;

    public Detalleventa() {
    }

    public Detalleventa(Integer iddetalleventa) {
        this.iddetalleventa = iddetalleventa;
    }

    public Detalleventa(Integer iddetalleventa, int idventa, int idpresentacion, int idmarca, int idtipoazucar, int cantidad) {
        this.iddetalleventa = iddetalleventa;
        this.idventa = idventa;
        this.idpresentacion = idpresentacion;
        this.idmarca = idmarca;
        this.idtipoazucar = idtipoazucar;
        this.cantidad = cantidad;
    }

    public Integer getIddetalleventa() {
        return iddetalleventa;
    }

    public void setIddetalleventa(Integer iddetalleventa) {
        this.iddetalleventa = iddetalleventa;
    }

    public int getIdventa() {
        return idventa;
    }

    public void setIdventa(int idventa) {
        this.idventa = idventa;
    }

    public int getIdpresentacion() {
        return idpresentacion;
    }

    public void setIdpresentacion(int idpresentacion) {
        this.idpresentacion = idpresentacion;
    }

    public int getIdmarca() {
        return idmarca;
    }

    public void setIdmarca(int idmarca) {
        this.idmarca = idmarca;
    }

    public int getIdtipoazucar() {
        return idtipoazucar;
    }

    public void setIdtipoazucar(int idtipoazucar) {
        this.idtipoazucar = idtipoazucar;
    }

    public int getCantidad() {
        return cantidad;
    }

    public void setCantidad(int cantidad) {
        this.cantidad = cantidad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddetalleventa != null ? iddetalleventa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Detalleventa)) {
            return false;
        }
        Detalleventa other = (Detalleventa) object;
        if ((this.iddetalleventa == null && other.iddetalleventa != null) || (this.iddetalleventa != null && !this.iddetalleventa.equals(other.iddetalleventa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Detalleventa[ iddetalleventa=" + iddetalleventa + " ]";
    }
    
}
